package com.example.service.system.Impl;

import com.example.dao.system.SysLogMapper;
import com.example.entity.system.SysLog;
import com.example.service.system.SysLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description: 数据库系统操作日志实现类
 * @Author runto
 * @Date 2023/11/5 10:02
 * @PackageName:com.example.service.system.Impl
 * @ClassName: sysLogServiceImpl
 * @Version 1.0
 */
@Service
public class sysLogServiceImpl implements SysLogService {

    @Autowired
    private SysLogMapper sysLogMapper;

    private static final Logger logger = LoggerFactory.getLogger(sysLogServiceImpl.class);

    @Override
    public int save(SysLog sysLog) {
        logger.info("正在保存数据库系统操作日志...,{}",sysLog);
        int res = sysLogMapper.insert(sysLog);
        if(res>0){
            logger.info("保存数据库系统操作日志成功...");
        }else{
            logger.info("保存数据库系统操作日志失败...");
        }
        return res;
    }
}
